<?php
error_reporting(0);
$indexpath = "index.php";
$cartpath = "data/cart.xml";

class cartSong{
	private $albumid = 0;
	private $trackno = 0;
	
	function cartSong($albumid, $trackno){
		$this->albumid = $albumid;
		$this->trackno = $trackno;
	}
	
	function setSong($albumid, $trackno){
		$this->albumid = $albumid;
		$this->trackno = $trackno;
	}
	
	function getTrackNo(){
		return $this->trackno;
	}
	
	function getAlbumID(){
		return $this->albumid;
	}
}

/*class cart{
	public $songList;
	public $songCount;
	
	function cart(){
		$this->songList = array();
		$this->songCount = 0;
	}
	
	function changeList($songList){
		$this->songList=$songList;
	}
	
	function addToCart($albumid, $trackno){
		$checker=0;	
		
		for($i=0;$i<count($this->songList);$i++){
			if( ($this->songList[$i]->getAlbumID()==$albumid) && ($this->songList[$i]->getTrackNo()==$trackno) )
				$checker=1;
		}
		
		if($checker==0){
			$song = new CartSong($albumid, $trackno);
			$this->songList[]=$song;
		}
		else
			echo "Song already exists in cart.";
	
		return $this->songList;
	}

	function removeFromCart($albumid, $trackno){
		$checker=0;
		
		for($i=0;$i<count($this->songList);$i++){
			if( ($this->songList[$i].getAlbumId()==$albumid) && ($this->songList[$i].getTrackNo()==$trackno) )
				$checker=1;
		}
		
		if($checker==1){
			array_splice($this->songList,$i);
		}
		else
			echo "Song does not exist in cart.";
			
		return $this->songList;
	}
	
	function emptyCart(){
		$this->songList = (array) null;
		return $this->songList;
	}
}*/
?>